VintaSoft Imaging .NET SDK 15.1: Documentation for .NET developer
Vintasoft.Imaging.Drawing Namespace / DrawingEngine Class / DrawImage Methods / DrawImage(VintasoftImage,PointF[]) Method
Syntax Example Requirements SeeAlso
In This Topic
DrawImage(VintasoftImage,PointF[]) Method (DrawingEngine)
In This Topic
Draws the specified VintasoftImage in the specified parallelogram.
Syntax
'Declaration

Public Overloads Sub DrawImage( _
ByVal image
The VintasoftImage to draw.
As Vintasoft.Imaging.VintasoftImage, _
ByVal destPoints
An array of three System.Drawing.PointF structures that represents the points of a parallelogram to which the upper-left, upper-right, and lower-left corners.
() As System.Drawing.PointF _
)
public void DrawImage(
Vintasoft.Imaging.VintasoftImage image,
System.Drawing.PointF[] destPoints
)

Parameters

image
The VintasoftImage to draw.
destPoints
An array of three System.Drawing.PointF structures that represents the points of a parallelogram to which the upper-left, upper-right, and lower-left corners.
Example

Here is an example that shows how to draw image using this drawing engine.


''' <summary>
''' Draws an image on specified drawing engine.
''' </summary>
''' <param name="drawingEngine">Drawing engine.</param>
''' <param name="area">Area to draw objects in.</param>
Public Shared Sub DrawImageExample(drawingEngine As DrawingEngine, area As RectangleF)
    ' path to image file for drawing
    ' this image is located in <install path>/VintaSoft/Imaging .NET/Images/
    Dim imagePath As String = "AutoContrast.jpg"

    ' create VintaSoft image
    Using image As New VintasoftImage(imagePath)
        ' create transform holder to save current engine transform and restore it aftewards
        Using drawingEngine.CreateTransformHolder()
            ' create image destination rectangle
            Dim imageRect As New RectangleF(area.X + area.Width * 0.25F, area.Y + area.Height * 0.25F, area.Width / 2, area.Height / 2)
            ' apply rotation transform to drawing engine
            drawingEngine.Transform = AffineMatrix.CreateRotation(35, imageRect.X + imageRect.Width / 2, imageRect.Y + imageRect.Height / 2)
            ' draw image
            drawingEngine.DrawImage(image, imageRect)
        End Using
    End Using
End Sub


/// <summary>
/// Draws an image on specified drawing engine.
/// </summary>
/// <param name="drawingEngine">Drawing engine.</param>
/// <param name="area">Area to draw objects in.</param>
public static void DrawImageExample(DrawingEngine drawingEngine, RectangleF area)
{
    // path to image file for drawing
    // this image is located in <install path>/VintaSoft/Imaging .NET/Images/
    string imagePath = "AutoContrast.jpg";

    // create VintaSoft image
    using (VintasoftImage image = new VintasoftImage(imagePath))
    // create transform holder to save current engine transform and restore it aftewards
    using (drawingEngine.CreateTransformHolder())
    {
        // create image destination rectangle
        RectangleF imageRect = new RectangleF(area.X + area.Width * 0.25f, area.Y + area.Height * 0.25f, area.Width / 2, area.Height / 2);
        // apply rotation transform to drawing engine
        drawingEngine.Transform = AffineMatrix.CreateRotation(35, imageRect.X + imageRect.Width / 2, imageRect.Y + imageRect.Height / 2);
        // draw image
        drawingEngine.DrawImage(image, imageRect);
    }
}

Requirements

Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

See Also